<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateExamPapersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('exam_papers', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('question_category_id')->comment("试题类别ID");
            $table->unsignedInteger('certificate_id')->comment("证书ID");
            $table->string('name')->comment("名称");
            $table->tinyInteger("is_published")->default(0)->comment("是否发布【否|是】");

            $table->string('publication_address')->comment("发布地址");
            $table->text('description')->comment("描述")->nullable();
            $table->unsignedInteger('order')->comment("排序")->default(0)->nullable() ;
            $table->tinyInteger("set_time_limit")->default(0)->comment("是否设置考试时间【否|是】");
            $table->unsignedInteger('time_limit')->comment("考试时长")->default(0)->nullable() ;
            $table->unsignedInteger('users_id')->comment("创建人id");
            $table->unsignedInteger('certification_score')->comment("获得认证分数");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('exam_papers');
    }
}
